import java.util.Scanner;

public class Test7 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int num = sc.nextInt();

        int sum = 0;

        for (int i = 1; i <= num; i++) {
            sum += (i + "").length();//先将i转化为字符串，再计算字符串的长度
        }

        System.out.println(sum);
    }
}
